﻿using Factory.RBAC.Accounts.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;

namespace Factory.RBAC.Accounts
{
    /// <summary>
    /// 账号
    /// </summary>
    public interface IAccountAppService:IApplicationService
    {

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="accountName">账号</param>
        /// <param name="accountPass">密码</param>
        /// <returns>返回用户的信息</returns>
        Task<Account> Log(string accountName, string accountPass);

        /// <summary>
        /// 用户显示（分页）
        /// </summary>
        /// <param name="page">页面</param>
        /// <param name="limit">页容量</param>
        /// <param name="accountName">用户名</param>
        /// <returns></returns>
        Task<PagedResult> Display(int page,int limit,string? accountName);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns>返回受影响行数</returns>
        Task<int> Delete(int id);


        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns>返回受影响行数</returns>
        Task<Account> Backfill(int id);

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="account">用户实体</param>
        /// <returns>返回受影响行数</returns>
        Task<int> Add(Account account);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="account">修改DTO</param>
        /// <returns>返回受影响行数</returns>
        Task<int> Update(UpdateAccountDto account);

        /// <summary>
        /// 获取用户数据
        /// </summary>
        /// <returns></returns>
        Task<List<Role>> Select();


        /// <summary>
        /// 五表联查
        /// </summary>
        /// <returns></returns>
        Task<List<Menu>> FiveTables(int id);


    }
}
